package com.oauth.facebook.server.global;

import java.util.EnumSet;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

import com.oauth.service.application.global.ApplicationGlobalService;
import com.oauth.service.application.global.beans.GlobalDataType;
import com.oauth.service.application.registry.beans.ApplicationInfoBean;

@Configuration
@ImportResource("classpath:config/facebook.properties")
public class FacebookInfoBean implements ApplicationInfoBean {

	@Value("#{facebook.key}")
	private Long mKey;

	@Value("#{facebook.name}")
	private String mName;

	@Value("#{facebook.addUrl}")
	private String mAddUrl;

	@Value("#{facebook.iconImageUrl}")
	private String mIconUrl;

	@Value("#{facebook.appImageUrl}")
	private String mImageUrl;

	private ApplicationGlobalService mAppGlobalService;

	private static EnumSet<GlobalDataType> mDataTypes = EnumSet.of(GlobalDataType.STATUS_UPDATE,
			GlobalDataType.BIRTHDAY_NOTIFACTION);

	public EnumSet<GlobalDataType> getGlobalDataType() {
		return mDataTypes;
	}

	@Override
	public String getAddUrl() {
		return mAddUrl;
	}

	@Override
	public ApplicationGlobalService getAppGlobalService() {
		return mAppGlobalService;
	}

	public void setAppGlobalService(ApplicationGlobalService pApplicationGlobalService) {
		mAppGlobalService = pApplicationGlobalService;
	}

	@Override
	public String getIconUrl() {
		return mIconUrl;
	}

	@Override
	public String getImageUrl() {
		return mImageUrl;
	}

	@Override
	public Long getKey() {
		return mKey;
	}

	@Override
	public String getName() {
		return mName;
	}

	/**
	 * @param pKey
	 *            the key to set
	 */
	public void setKey(Long pKey) {
		mKey = pKey;
	}

	/**
	 * @param pName
	 *            the name to set
	 */
	public void setName(String pName) {
		mName = pName;
	}

	/**
	 * @param pAddUrl
	 *            the addUrl to set
	 */
	public void setAddUrl(String pAddUrl) {
		mAddUrl = pAddUrl;
	}

	/**
	 * @param pIconUrl
	 *            the iconUrl to set
	 */
	public void setIconUrl(String pIconUrl) {
		mIconUrl = pIconUrl;
	}

	/**
	 * @param pImageUrl
	 *            the imageUrl to set
	 */
	public void setImageUrl(String pImageUrl) {
		mImageUrl = pImageUrl;
	}

}
